package com.googlecode.gxtmvp.rest.client;

import com.google.gwt.user.client.rpc.AsyncCallback;

public abstract class RestCallback<D> implements AsyncCallback<D> {
  
  private final CanReportError canReportError;
  
  public RestCallback(final CanReportError canReportError) {
    this.canReportError = canReportError;
  }
  
  @Override
  public void onFailure(final Throwable caught) {
    canReportError.reportError(caught);
  }
  
}
